package com.patternsbox.behavioral.observer;

class ConcreteObserver implements Observer {

	private String name;
	private Subject subject;
	private String state;

	public ConcreteObserver(Subject subject, String name) {
		this.name = name;
		this.subject = subject;
	}

	public void update() {
		state = subject.getSubjectState();
		System.out.println("Observer {" + name + "}'s new state is {" + state
				+ "}");
	}

}
